From 57881dfacc04e59109fee1e82829418edb4871ff Mon Sep 17 00:00:00 2001 From: "awilliam@xenbuild.aw" Date: Fri, 31 Mar 2006 14:03:07 -0700 Subject: [PATCH] [IA64] vcpu_match_tr_entry cpu_match_tr_entry moved from vcpu.h to vcpu.c, is now an inlined function and its range check is fixed. Signed-off-by: Tristan Gingold --- xen/arch/ia64/xen/vcpu.c | 8 ++++++++ xen/include/asm-ia64/vcpu.h | 6 +----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/xen/arch/ia64/xen/vcpu.c b/xen/arch/ia64/xen/vcpu.c index 10abd30aca..5d3e989db2 100644 --- a/xen/arch/ia64/xen/vcpu.c +++ b/xen/arch/ia64/xen/vcpu.c @@ -1273,6 +1273,14 @@ unsigned long recover_to_break_fault_count = 0; int warn_region0_address = 0; // FIXME later: tie to a boot parameter? +// FIXME: also need to check && (!trp->key || vcpu_pkr_match(trp->key)) +static inline int vcpu_match_tr_entry(TR_ENTRY *trp, UINT64 ifa, UINT64 rid) +{ + return trp->p && trp->rid == rid + && ifa >= trp->vadr + && ifa <= (trp->vadr + (1L << trp->ps) - 1); +} + IA64FAULT vcpu_translate(VCPU *vcpu, UINT64 address, BOOLEAN is_data, BOOLEAN in_tpa, UINT64 *pteval, UINT64 *itir, UINT64 *iha) { unsigned long region = address >> 61; diff --git a/xen/include/asm-ia64/vcpu.h b/xen/include/asm-ia64/vcpu.h index c38e2fc590..a7c5f1a9fd 100644 --- a/xen/include/asm-ia64/vcpu.h +++ b/xen/include/asm-ia64/vcpu.h @@ -16,6 +16,7 @@ typedef struct vcpu VCPU; typedef cpu_user_regs_t REGS; +/* Note: PSCB stands for Privilegied State Communication Block. */ #define VCPU(_v,_x) (_v->arch.privregs->_x) #define PSCB(_v,_x) VCPU(_v,_x) #define PSCBX(_v,_x) (_v->arch._x) @@ -185,10 +186,5 @@ itir_mask(UINT64 itir) #define vcpu_quick_region_set(_tr_regions,_ifa) \ do {_tr_regions |= (1 << ((unsigned long)_ifa >> 61)); } while (0) -// FIXME: also need to check && (!trp->key || vcpu_pkr_match(trp->key)) -#define vcpu_match_tr_entry(_trp,_ifa,_rid) \ - ((_trp->p && (_trp->rid==_rid) && (_ifa >= _trp->vadr) && \ - (_ifa < (_trp->vadr + (1L<< _trp->ps)) - 1))) - #endif -- 2.30.2